package edu.nf.ch06.service;

import edu.nf.ch06.entity.User;
import edu.nf.ch06.mapper.UserMapper;
import edu.nf.ch06.util.MybatisUtils;
import org.apache.ibatis.session.SqlSession;

/**
 * @author CSY
 * @date 2025 - 04 - 24
 */
public class UserService {
    public User getUserById(int id) {
        try(SqlSession sqlSession = MybatisUtils.getSqlSession()) {
            return sqlSession.getMapper(UserMapper.class).getUserById(id);
        }
    }
}
